package org.airlink.persistence.criteria.expressions
{
	import flash.utils.Dictionary;
	
	import flex.persistence.criteria.Expression;
	
	import org.airlink.persistence.criteria.CriteriaBuilderImpl;
	import org.airlink.persistence.criteria.PredicateImpl;
	
	public class LessThanOrEqual extends PredicateImpl
	{
		private var x:Expression;
		private var y:*;
		public function LessThanOrEqual(criteriaBuilder:CriteriaBuilderImpl, x:Expression, y:*) 	{	
			_parameters =  new Array();
			_parameters["x"] = x;		
			if(y is Expression)
				_parameters["y"] = y;
			else
				_parameters["y"] = criteriaBuilder.pushParameter(y);	
		}
		
		override public function toString():String{
			var string:String = "";
			string += "(";
			string += _parameters["x"];
			string += "<=";			
			if(_parameters["y"] is Expression)
				string += _parameters["y"];
			else 
				string += ":p"+_parameters["y"];
			string += ")";
			return string;
		}		
	}
	
}